package org.toools.gwt.demo.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import java.util.List;
import org.toools.gwt.demo.jpa.Account;
import org.toools.gwt.demo.jpa.Additive;
import org.toools.gwt.demo.jpa.Application;
import org.toools.gwt.demo.jpa.Company;
import org.toools.gwt.demo.jpa.CompanyPart;
import org.toools.gwt.demo.jpa.Container;
import org.toools.gwt.demo.jpa.Disposer;
import org.toools.gwt.demo.jpa.Waste;

public interface DemoService extends RemoteService {

    public static class Util {
		private static DemoServiceAsync instance;
		public static DemoServiceAsync getInstance(){
			if (instance == null) {
				instance = (DemoServiceAsync) GWT.create(DemoService.class);
				ServiceDefTarget target = (ServiceDefTarget) instance;
				target.setServiceEntryPoint(GWT.getHostPageBaseURL() + "/tooolsService");
                System.out.println("setServiceEntryPoint: " + target.getServiceEntryPoint());
			}
			return instance;
		}
	}
    
    Account getAccountByID(Integer ID);
    List<Account> getAccounts();

    Additive getAdditiveByID(Integer ID);
    List<Additive> getAdditives();

    Application getApplicationByID(Integer ID);
    List<Application> getApplications();

    Company getCompanyByID(Integer ID);
    List<Company> getCompanies();

    CompanyPart getCompanyPartByID(Integer ID);
    List<CompanyPart> getCompanyParts();

    Container getContainerByID(Integer ID);
    List<Container> getContainers();

    Disposer getDisposerByID(Integer ID);
    List<Disposer> getDisposers();

    Waste getWasteByID(Integer ID);
    List<Waste> getWaste();

    String test();
}